package fm.controller;

import fm.dto.NeiyiUser;
import fm.mongoService.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * Created by 61741 on 2017/12/4.
 */
@Controller
@RequestMapping("/shop")
public class ShopController extends BaseController {
    @Autowired
    UserService userService;
    @RequestMapping("/index/{user_id}")
    public String index(ModelMap modelMap, @PathVariable String user_id){
        LOGGER.info(user_id);
        NeiyiUser user = userService.getById(user_id);
        Integer userType = user.getUserType();
        modelMap.put("user_id",user_id);
        modelMap.put("userType",userType);
        return "portal/shop";
    }
}
